﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Runtime.Serialization;
using CommonDataContracts;
using System.ComponentModel;


namespace SharedDataContracts
{
    [DataContract]
    public class BacteriumProfile : INotifyPropertyChanged
    {
        private BacteriumSnapshot _snapshot;
        private BacteriumEventVector _events = new BacteriumEventVector();

        public event PropertyChangedEventHandler PropertyChanged;

        [DataMember]
        public BacteriumSnapshot Snapshot
        {
            get { return _snapshot; }
            set 
            { 
                _snapshot = value;
                NotifyChanged("Snapshot");
            }
        }

        [DataMember]
        public BacteriumEventVector Events
        {
            get { return _events; }
            set 
            { 
                _events = value;
                NotifyChanged("Events");
            }

        }

        public BacteriumProfile()
        {

        }

        public BacteriumProfile(BacteriumSnapshot snapshot)
        {
            Snapshot = snapshot;
            
        }

        protected void NotifyChanged(String name)
        {
            PropertyChangedEventHandler handler = PropertyChanged;
            if (handler != null)
            {
                handler(this, new PropertyChangedEventArgs(name));
            }
        }


    }
}
